package models
import(
	"strconv"
	"strings"
	"fmt"
)
var User user
type user struct {
	Id int
	Name int
}

func (user *user) GetUserById(id int) {
	fmt.Println("")

	//var user_id int
	//app.DB.QueryRow("select user_id from task_counting where user_id = 6" ).Scan(&user_id)
	//fmt.Println(user_id,"user_id" )
}

func (user *user) GetIds(users []user) (string) {
	ids :=  []string{}
	var is_exist bool
	for _,user := range users {
		is_exist = false
		for _,id := range ids {
			if id == strconv.Itoa(user.Id) {
				is_exist = true
			}
		}
		if is_exist == false{
			ids = append(ids,strconv.Itoa(user.Id))
		}
	}
	return strings.Join(ids,",")
}
